package cn.yunhe.controller;


import cn.yunhe.entity.Question;
import cn.yunhe.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;


@RestController
public class QuestionController {
    @Autowired
    @Qualifier("questionService")

    private QuestionService questionService;
    @RequestMapping("/practice-improve")
    public ModelAndView getQuestionList1(){
        ModelAndView mv = new ModelAndView();
        mv.setViewName("practice-improve");
        return mv;
    }
    @RequestMapping("/questionList")
    public List<Question> getQuestionList(){
        List<Question> questionList= questionService.getQuestionList();
        return questionList;
    }

}
